﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace SurfaceApplication3
{
    class BulletManager
    {
        List<Bullet> bullets;
        Texture2D tower_bullet;
        public BulletManager()
        {
            bullets = new List<Bullet>();
        }
        
        public void add_bullet(BulletKind kind,Vector2 position, float orientation){
            switch(kind){
                case BulletKind.tower:
                    bullets.Add(new Bullet(tower_bullet, position,4,orientation));
                break;
            }
        }

        public void update(){
            foreach (Bullet bullet in bullets)
            {
                bullet.uptade();
            }
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            foreach (Bullet bullet in bullets)
            {
                bullet.Draw(spriteBatch);
            }
        }

        public void LoadContent(ContentManager Content){
            tower_bullet = Content.Load<Texture2D>("bullet");
        }
    }
}
